import log from '@dfeidao/atom-nodejs/logger/log';
import { IncomingHttpHeaders } from 'http';
import query from "@dfeidao/atom-nodejs/db/query";
import { systemid, productid } from '../../atom/config';
interface Message {
	// cookie: {
	// 	uk: string;
	// 	[key: string]: string
	// };
	// urls: {
	// 	base: string;
	// 	origin: string;
	// 	url: string;
	// };
	// query: {};
	// params: {};
	// headers: {};
	// captcha: string;
}

interface IWebResult {
	data: unknown;
	cookie?: {
		[name: string]: string;
	} | null;
	content_type?: string;
	headers?: {
		[key: string]: string[];
	};
	attachment?: string;
	redirect?: string;
	status_code?: number;
}

export default async function atom(message: Message, action_id: string, session_id: string, headers: IncomingHttpHeaders): Promise<IWebResult> {
	log('Service begin path:e:\王举\学习文件\飞道工作文件\测试项目\kh\src\wangju\zj-000004\s001,action_id:' + action_id);

	const { prepare, exec } = query(action_id, session_id, systemid);
	prepare('plan_classify', ['plan_cla_attr_no', 'plan_cla_attr_name'], { productid }, 200, 1, [], []);
	const [dt] = await exec();



	log('Service end path:e:\王举\学习文件\飞道工作文件\测试项目\kh\src\wangju\zj-000004\s001,action_id:' + action_id);
	return { data: { dt } } as IWebResult;
}
